package com.mayikt.edu.init;

import com.mayikt.edu.service.IStartPreheatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/** 项目启动成功预热 */
@Component
@Slf4j
public class StartPreatApplicationRunner implements ApplicationRunner {
  @Autowired private IStartPreheatService iStartPreheatService;

  @Override
  public void run(ApplicationArguments args) throws Exception {
    log.info("[开始预热db中数据到缓存中]");
    iStartPreheatService.initData();
  }
}
